Skip to content
  • 0 Votes
    4 Posts
    3k Views
    aha_1980A
    @maxime.armand Have you actually tried it? It does exactly what you demand in step 1. And if you look in http://doc.qt.io/qt-5/qtserialport-creaderasync-main-cpp.html you will see that the serial port and the baud rate are given as command line parameters. Just (cross-)compile the program for the Raspberry, and run it. It should work like your HypterTerminal test.
  • Problem facing with QT serial port module

    Solved General and Desktop serial port desktop qt5.9.1
    5
    1 Votes
    5 Posts
    3k Views
    P
    @Dhani - thanks from me too. This fixed the same problem I was having connecting to a virtual serial port on an NXP dev board.
  • SerialPort in a different Thread

    Solved General and Desktop qthread serial port qtimer
    2
    0 Votes
    2 Posts
    1k Views
    J.HilkJ
    Never mind, I had code in my the constructor of the to be threaded class, that caused the conflict... connect(&modbusThread, &QThread::started, modbusDevice, &Modbus::setupClass); fixed the issue.
  • QSerialPort handle on Windows

    Unsolved General and Desktop serial port windows native code
    4
    0 Votes
    4 Posts
    2k Views
    R
    The overlapped mode is the problem. If you only have a handle then ReadFile / WriteFile will fail if you don't include the overlapped structure in the call. It was opened with the OVERLAPPED flag so this parameter cannot be NULL. What exactly are you trying to do? Maybe there is another way.
  • Serial port

    Unsolved General and Desktop serial port
    2
    0 Votes
    2 Posts
    776 Views
    SGaistS
    Hi and welcome to devnet, You have several examples for the QtSerialPort module that should help you get started. Hope it helps
  • Receiving data packets from the serial port

    Unsolved General and Desktop serial serial port frame
    5
    0 Votes
    5 Posts
    3k Views
    Basti46B
    @Wieland Well i found my problem, I chose the wrong baudrate. Now i have to adjust my code, but i think it will work sooner or later. Thanks again!
  • 0 Votes
    5 Posts
    3k Views
    hussam.YonesH
    @Wieland, this float number is represent the speed Value of DC motor in RPM, may you mean I it should be in double type or something else!!. in fact I don't know obviously whit's the type I should use this is the GUI I built link text you can see in Stack-overflow here: link text may you get what I need, I'am sory to be annoying but I spent alot of time in this problem :(
  • 1 Votes
    13 Posts
    9k Views
    ArasA
    I am also trying to write a minimal qml app that uses the built in GPS to retrieve current position. I am not sure if I can use Qt positioning or if I should just parse the raw output of the GPS myself, like the OP did here, and extract the position manually. It seems very dirty to do it that way, I thought there would be a nice API in QML that I could use. Anyone can point to a simple example?
  • 0 Votes
    6 Posts
    5k Views
    SGaistS
    Then I'd recommend taking a look the example code and rewrite yours to match it.
  • read and write in serial port

    Solved QML and Qt Quick qml serial port
    13
    0 Votes
    13 Posts
    25k Views
    A
    https://www.youtube.com/watch?v=7ny6Hrdc_2M&t=47s
  • Serial Port : Unique Read Error

    Unsolved General and Desktop serial port
    2
    0 Votes
    2 Posts
    909 Views
    mrjjM
    @Dhinesh said: HI and welcome The signal readyRead (serialReceived) is sent when QSerialPort reads some data. Try to not call serial->write("1",1); in your serialReceived as it might make controller send more data and it might never get out of there. (end less loop) as its called pretty fast. Else they code seems fine. Maybe say QByteArray data.append( serial->readAll()); (and move QByteArray data to MainWindow.h) and then when data.size() == 8 then DOSTUFF data.clear();
  • 0 Votes
    8 Posts
    5k Views
    P
    @Rondog @kuzulis I'm going to give the bytesWritten()signal a try, I will let you know how it worked out. I don't have a separate thread set up, but it's definitely worth the try! Big thanks for the reply's!
  • Qt to arduino Serial number

    3rd Party Software arduino serial serial port
    2
    0 Votes
    2 Posts
    3k Views
    SGaistS
    Hi and welcome to devnet, Why the double conversion to stdString and c_str ? You can use something like toLatin1 if you want a QByteArray to write to your serial port.
  • Qt4 -i want serial communication

    General and Desktop serial port serial
    2
    0 Votes
    2 Posts
    1k Views
    K
    Use QtSerialPort instead (branch qt4-dev): http://code.qt.io/cgit/qt/qtserialport.git/?h=qt4-dev Wiki: https://wiki.qt.io/Qt_Serial_Port PS: Also you can install QtSerialPort from the Fedora's repo
  • 0 Votes
    11 Posts
    4k Views
    P
    Thanks for your reply... I agree that may be my code is not the best practice, as i learn Qt by myself only with doc and tutorials... but the program was working perfectly when i delivered it to the researchers... In fact, is working perfectly if i compile it on windows... few hour ago i borrowed a windows machine, installed qt, compiled the same project and worked just fine... So i doubt is really a code problem, because it should appear in both Windows and Linux, as the code is exactly the same... I'm starting to think that is a linux driver problem, so i will try in another linux when i get the chance... If someone has ubuntu 15.04 and is kind enough to reproduce this problem and tell me i would be very happy! If anybody else reproduce this problem in other linux machine i will start a bug report
  • 0 Votes
    11 Posts
    7k Views
    ivanperinoI
    @kuzulis I used putty just to send data to my app. As you suggest, putty doesn´t detect parity errors.
  • QSerialPort communication

    General and Desktop serial port qserialport com
    2
    0 Votes
    2 Posts
    2k Views
    R
    This might be the culprit: while (serial->waitForReadyRead(200)) This will put your thread to sleep until data has arrived or 200 ms has elapsed. QSerialPort seems to rely on the message loop to handle data so this might interfere with it (?). There is no guarantee that you will have 512 bytes of data back at once either. There is a signal (QSerialPort::readyRead() ) you can use when received data arrives. Connect this to a suitable slot and buffer what has arrived each time the signal is fired (I assume you will not get all the data at once). Do this until you have 512 bytes then process it. Keep the event loop active if you have some other 'heavy' function somewhere (QApplication::processEvents() ).
  • 0 Votes
    19 Posts
    17k Views
    M
    I am sorry about my last post. I made a stupid error. I updatet to QT5.5, but I haven't reconfigurated the project, so I was still using QT5.4. Now I tried also the Chipi-X10 USB-RS converters. I have to say, they work a lot better. I have now for all three ports, this converter. With the others, a lot of times I had to unplug and replug the connectors to get dem work. So there is something strange. The Chipi worked really good until now, thank you jeroen3, this will save a lot of time. After building the programm with QT5.5, the programm also work a lot better. I saw that the qcustemplot keeps plotting while I drag and drop the window. I have sometimes errors but now only sporadic. For example when I resize the window very fast, I can provoke it. But in general the errorrate is about one or two percent, and with that I can live. PS: We here do not play in telepathists and predictors. If you want to get help, you should provide the minimal and simple example.... My problem was, that with the minimal simple example all seems to working. This communication problem I had only, wenn all the data was coming and when I was plotting someting in the same time. And I checked my code a lot of times. The problem is, my knowhow about QT and generell about programming with PCs is not very big. So I think there is something I do not know. So when I check my code a hundet times more, I will not find an error. I made also an easy experiment to isolate the error: My I slowed up the replot, so that I plot only every tenth time, but ten points at the same time. Like this I can see, that this error, comes only when the window is plotting. The error comes more, the more points he has to plot on the screen. So if I make fullscreen, and I set up the scale so that I have the maximum of points in the axis, the error comes every time again. So QT has an influence to this problem. I think there is an overflow in some buffer, beause the program is to slow to read it or that he overwrites any part for some other reasons. But anyway.. For me I will pay attention now to not overcharge my comuter :) Thank you for all help!
  • 0 Votes
    2 Posts
    1k Views
    R
    I used Qextserialport from git clone https://code.google.com/p/qextserialport/ and the problem is solved to a great extent. With Qextserialport, around 4% of the bytes get dropped at 115200 baud. On decreasing the speed to 9600, data reception is much better. Only issue is that of the initial 160-190 bytes that are received, some bytes are missing. After the initial 190 bytes, there is no loss at all. Since the loss seems to be predictable, I plan to append some known value 200 times ahead of the actual data and send the whole sequence. The known value will be neglected at the receiver end in software.
  • 0 Votes
    6 Posts
    3k Views
    SGaistS
    You're welcome ! Since you have it working now, please update the thread title prepending [solved] so other forums users may know a solution has been found :)